﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Wpftest.CustomCommand
{
    class PasteCommmand:ICommand
    {
        public bool CanExecute(object parameter)
        {
            throw new NotImplementedException();
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            ICustomCommand command = parameter as ICustomCommand;
            command.Paste();
        }
    }
    class CleanCommmand : ICommand
    {
        public bool CanExecute(object parameter)
        {
            throw new NotImplementedException();
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            //下面两种方式都可以
            CommandTarget command = parameter as CommandTarget;
            //ICustomCommand command = parameter as ICustomCommand;
            command.Clean();
        }
    }
}
